<nz-spin [nzSpinning]="_isSpinning" [nzTip]="'正在读取数据...'">
<div class="table-operations" style="overflow: hidden;">
  <nz-datepicker style="float: left;margin-right: 12px" (ngModelChange)="_startDate=$event;_startValueChange()" [(ngModel)]="_startDate" [nzDisabledDate]="_disabledStartDate"  [nzFormat]="'YYYY-MM-DD'" [nzPlaceHolder]="'开始日期'"></nz-datepicker>
  <nz-datepicker style="float: left;margin-right: 12px" (ngModelChange)="_endDate=$event;_endValueChange()" [(ngModel)]="_endDate" [nzDisabledDate]="_disabledEndDate"  [nzFormat]="'YYYY-MM-DD'" [nzPlaceHolder]="'结束日期'"></nz-datepicker>

  <div style="float: left; margin-right: 24px" >
  <span>审核状态 : &nbsp;</span>
  <nz-select style="width: 88px;" [(ngModel)]="single" (ngModelChange)="getDatas()"  [nzShowSearch]="true" >
    <nz-option
      [nzLabel]="'-请选择-'"
      [nzValue]="''">
    </nz-option>
    <nz-option
      [nzLabel]="'待审核'"
      [nzValue]="'0'">
    </nz-option>
    <nz-option
      [nzLabel]="'已通过'"
      [nzValue]="'1'">
    </nz-option>
    <nz-option
      [nzLabel]="'未通过'"
      [nzValue]="'2'">
    </nz-option>
  </nz-select>
  </div>
    <nz-input  style="width: 260px;float: left; margin-right: 24px" [(ngModel)]="inputValue" [nzPlaceHolder]="'请输入搜索内容...'" (keyup.enter)="getDatas()">
      <ng-template #addOnBefore>
        <nz-select style="width: 66px;"[nzPlaceHolder]="'全部'"  (ngModelChange)="getDatas()"  [(ngModel)]="selectValue">
          <nz-option [nzLabel]="'全部'"  [nzValue]="'0'"></nz-option>
          <nz-option [nzLabel]="'书名'" [nzValue]="'1'"></nz-option>
          <nz-option [nzLabel]="'作者'" [nzValue]="'2'"></nz-option>
          <nz-option [nzLabel]="'书本内容'" [nzValue]="'3'"></nz-option>
        </nz-select>
      </ng-template>
      <ng-template #addOnAfter>
        <i class="anticon anticon-search ant-input-search-icon" (click)="getDatas()"></i>
      </ng-template>
    </nz-input>
  <button nz-button style="float: left" [nzType]="'primary'" (click)="reset()">重置</button>
  <button nz-button style="float: right" [nzType]="'danger'" (click)="deleteAll()">全部删除</button>
</div>
<nz-table #nzTable [nzDataSource]="data" [nzPageSize]="10" [nzIsPagination]="false">
  <thead nz-thead>
  <tr>
    <th nz-th [nzCheckbox]="true">
      <label nz-checkbox [(ngModel)]="_allChecked" [nzIndeterminate]="_indeterminate" (ngModelChange)="_checkAll($event)">
      </label>
    </th>
    <th nz-th>
      <span>书名</span>
    </th>
    <th nz-th>
      <span>名称</span>
      <nz-table-sort [(nzValue)]="sortMap.name" (nzValueChange)="sort('name',$event)"></nz-table-sort>
      <nz-dropdown [nzTrigger]="'click'">
        <i class="anticon anticon-filter" nz-dropdown></i>
        <ul nz-menu>
          <li nz-menu-item *ngFor="let filter of filterNameArray">
            <label nz-checkbox [(ngModel)]="filter.value">
              <span>{{filter.name}}</span>
            </label>
          </li>
        </ul>
        <div nz-table-filter>
          <span nz-table-filter-confirm (click)="search()">好</span>
          <span nz-table-filter-clear (click)="reset(filterNameArray)">重置</span>
        </div>
      </nz-dropdown>
    </th>
    <th nz-th>
      <span>作者</span>
      <nz-table-sort [(nzValue)]="sortMap.author" (nzValueChange)="sort('author',$event)"></nz-table-sort>
    </th>
    <th nz-th>
      <span>更新时间</span>
      <nz-table-sort [(nzValue)]="sortMap.updateDate" (nzValueChange)="sort('updateDate',$event)"></nz-table-sort>
    </th>
    <th nz-th>
      <span>地址</span>
      <nz-table-sort [(nzValue)]="sortMap.address" (nzValueChange)="sort('address',$event)"></nz-table-sort>
    </th>
    <th nz-th>
      <span>状态</span>
      <nz-table-sort [(nzValue)]="sortMap.examineCN" (nzValueChange)="sort('examineCN',$event)"></nz-table-sort>
    </th>
    <th nz-th><span>操作</span></th>
  </tr>
  </thead>
  <tbody nz-tbody>
  <tr nz-tbody-tr *ngFor="let data of nzTable.data">
    <td nz-td [nzCheckbox]="true">
      <label nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="_refreshStatus($event)">
      </label>
    </td>
    <td nz-td>
      <a>{{data.book}}</a>
    </td>
    <td nz-td>
      {{data.name}}
    </td>
    <td nz-td>{{data.author}}</td>
    <td nz-td>{{data.updateDate | date: 'yyyy-MM-dd' }}</td>
    <td nz-td>
      <nz-tooltip [nzTitle]="data.address" [nzPlacement]="'bottom'">
        <span nz-tooltip class="oneline">{{data.address}}</span>
      </nz-tooltip>
    </td>
    <td nz-td>{{data.examineCN}}</td>
    <td nz-td>
      <span>
        <a [routerLink]="['/layout/section2detail',data.id]">审核</a>
        <span nz-table-divider></span>
        <a (click)="deleteAll(data.id)" >删除</a>
      </span>
    </td>
  </tr>
  </tbody>
</nz-table>
<nz-pagination style="float: right;margin-top: 12px;margin-bottom: 24px" [nzPageSize]="pagesize" [(nzPageIndex)]="pageindex" (nzPageIndexChange)="getDatas()" [nzTotal]="nztotal" nzShowQuickJumper></nz-pagination>
</nz-spin>
